package com.sikaryofficial.backend.domain.mapping;

import com.sikaryofficial.backend.domain.dto.req.AddressUserReq;
import com.sikaryofficial.backend.domain.dto.resp.AddressUserListDTO;
import com.sikaryofficial.backend.domain.entity.UserAddress;
import com.sikaryofficial.backend.domain.vo.export.UserAddressExportVO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author : qinjinyuan
 * @desc : 收货地址实体类映射
 * @date : 2023/11/03 9:19
 */
@Mapper
public interface UserAddressMapping {
    UserAddressMapping INSTANCE = Mappers.getMapper(UserAddressMapping.class);

    /**
     * 实体映射resp
     *
     * @param addressUser
     * @return
     */
    AddressUserListDTO coverToResp(UserAddress addressUser);

    /**
     * 实体映射req
     *
     * @param req
     * @return
     */
    UserAddress coverToReq(AddressUserReq req);

    /**
     * 实体集合映射resp
     *
     * @param addressUserList
     * @return
     */
    List<AddressUserListDTO> coverListToResp(List<UserAddress> addressUserList);

    UserAddressExportVO coverToExportVO(AddressUserListDTO addressUserList);
}
